|
Kameleon-Plus
0.3.2
|
TODO: Brief description of Model class. More...
#include <ccmc/Model.h>


Public Member Functions | |
| Model () | |
| virtual long | open (const std::string &filename)=0 |
| Opens a file. | |
| void | setModelName (std::string modelName) |
| Sets the model name to modelName. | |
| std::string | getModelName () |
| Returns the modelName of the currently selected file. | |
| long | loadVariable (const std::string &variable) |
| Load a variable into memory. | |
| long | unloadVariable (const std::string &variable) |
| Unload a variable from memory. This will return FileReader::OK if the variable is removed from memory, and FileReader::VARIABLE_NOT_IN_MEMORY if the variable was not already in memory. | |
| long | loadVariableInt (const std::string &variable) |
| Loads a variable into memory. | |
| std::vector< float > * | getVariableFromMapRW (const std::string &variable) |
| Returns a pointer to the entry in the variableData map containing the variable data. | |
| std::vector< int > * | getIntVariableFromMapRW (const std::string &variable) |
| Returns a pointer to the entry in the variableDataInt map containing the variable data. | |
| const std::vector< float > *const | getVariableFromMap (const std::string &variable) |
| Returns a const pointer to the entry in the variableData map containing the variable data. | |
| const std::vector< int > *const | getIntVariableFromMap (const std::string &variable) |
| Returns a const pointer to the entry in the variableDataInt map containing the variable data. | |
| void | addFloatVariableToMap (const std::string &variable, std::vector< float > *variableData) |
| const std::vector< float > *const | getVariableFromMap (long variable_id) |
| Returns a const pointer to the entry in the variableDataByID map containing the variable data. | |
| const std::vector< int > *const | getIntVariableFromMap (long variable_id) |
| Returns a const pointer to the entry in the variableDataIntByID map containing the variable data. | |
| std::vector< float > * | getVariableFromMapRW (long variable_id) |
| Returns a pointer to the entry in the variableDataByID map containing the variable data. | |
| std::vector< int > * | getIntVariableFromMapRW (long variable_id) |
| Returns a pointer to the entry in the variableDataIntByID map containing the variable data. | |
| virtual const std::vector < std::string > | getLoadedVariables () |
| Returns the list of variables that have been loaded into memory, using the loadVariable or loadVectorVariable methods. | |
| void | setMissingValue (float missingValue) |
| Sets the missing value to use when no valid data exists. | |
| float | getMissingValue () |
| Returns the missing value that will be returned when no valid data exists. | |
| float | getConversionFactorToSI (const std::string &variable) |
| Returns the conversion factor needed to convert the interpolated value to SI units. | |
| std::string | getNativeUnit (const std::string &variable) |
| Fetches the native units of the variable as stored in the file. | |
| std::string | getSIUnit (const std::string &variable) |
| Returns the SI units of the specified variable. | |
| int | getProgress () |
| int | getBusyStatus () |
| long | close () |
| Closes the currently selected file. | |
| virtual Interpolator * | createNewInterpolator ()=0 |
| Returns an Interpolator object for the currently opened file. | |
| virtual | ~Model () |
Public Member Functions inherited from ccmc::GeneralFileReader | |
| GeneralFileReader () | |
| long | open (const std::string &filename) |
| std::vector< float > * | getVariable (const std::string &variable) |
| std::vector< float > * | getVariable (long variableID) |
| std::vector< float > * | getVariable (const std::string &variable, long startIndex, long count) |
| std::vector< float > * | getVariable (long variableID, long startIndex, long count) |
| float | getVariableAtIndex (const std::string &variable, long index) |
| float | getVariableAtIndex (long variable_id, long index) |
| std::vector< int > * | getVariableInt (const std::string &variable) |
| int | getVariableIntAtIndex (const std::string &variable, long index) |
| int | getNumberOfGlobalAttributes () |
| int | getNumberOfVariables () |
| int | getNumberOfVariableAttributes () |
| long | getNumberOfRecords (const std::string &variable) |
| long | getNumberOfRecords (long variable_id) |
| long | getVariableID (const std::string &variable) |
| std::string | getVariableName (long variable_id) |
| Attribute | getGlobalAttribute (long i) |
| std::string | getGlobalAttributeName (long attribute_id) |
| std::string | getVariableAttributeName (long attribute_id) |
| Attribute | getGlobalAttribute (const std::string &attribute) |
| Attribute | getVariableAttribute (const std::string &variable, const std::string &attribute) |
| std::vector< std::string > | getVariableAttributeNames () |
| bool | doesAttributeExist (const std::string &attribute) |
| bool | doesVariableExist (const std::string &variable) |
| long | close () |
| const std::string & | getCurrentFilename () |
| ~GeneralFileReader () | |
Static Public Attributes | |
| static const int | BUSY =1 |
| static const int | OK =2 |
Protected Types | |
| typedef boost::unordered_map < std::string, std::vector < float > * > | mapStringFloat |
| typedef boost::unordered_map < std::string, std::vector < int > * > | mapStringInt |
| typedef boost::unordered_map < long, std::vector< float > * > | mapLongFloat |
| typedef boost::unordered_map < long, std::vector< int > * > | mapLongInt |
Protected Member Functions | |
| virtual void | initializeConversionFactorsToSI ()=0 |
| Initializes the conversionFactorsToSI map. | |
| void | setBusyStatus (int busyStatus) |
| virtual void | initializeSIUnits ()=0 |
| Initializes the variableSIUnits map. | |
Protected Member Functions inherited from ccmc::GeneralFileReader | |
| void | initializeGlobalAttributes () |
| void | initializeVariableAttributes () |
| void | initializeVariableIDs () |
| void | initializeVariableNames () |
Protected Attributes | |
| std::string | modelName |
| boost::unordered_map < std::string, float > | conversionFactorsToSI |
| boost::unordered_map < std::string, std::string > | variableSIUnits |
| boost::unordered_map < std::string, std::vector < float > * > | variableData |
| boost::unordered_map < std::string, std::vector < int > * > | variableDataInt |
| boost::unordered_map< long, std::vector< float > * > | variableDataByID |
| boost::unordered_map< long, std::vector< int > * > | variableDataIntByID |
| std::string | units_ |
| float | missingValue |
| int | busyStatus |
| int | progress |
| int | variablesAdded |
Protected Attributes inherited from ccmc::GeneralFileReader | |
| std::string | current_filename |
| boost::unordered_map < std::string, long > | variableIDs |
| boost::unordered_map< long, std::string > | variableNames |
| boost::unordered_map < std::string, Attribute > | gAttributes |
| boost::unordered_map< long, Attribute > | gAttributeByID |
| boost::unordered_map < std::string, boost::unordered_map < std::string, Attribute > > | vAttributes |
| FileReader * | fileReader |
|
protected |
|
protected |
|
protected |
|
protected |
| ccmc::Model::Model | ( | ) |
Default constructor
|
virtual |
Destructor
| void ccmc::Model::addFloatVariableToMap | ( | const std::string & | variable, |
| std::vector< float > * | variableData | ||
| ) |
| long ccmc::Model::close | ( | ) |
Closes the currently selected file.

|
pure virtual |
Returns an Interpolator object for the currently opened file.
This returns an Interpolator object that contains all the necessary local variables required to interpolate independent of any other Interpolator object. The pointer must be deleted from the calling program.
Implemented in ccmc::Adapt3D, ccmc::OpenGGCM, ccmc::BATSRUS, ccmc::CTIP, ccmc::LFM, ccmc::ENLIL, ccmc::Magnetogram, ccmc::MAS, and ccmc::SWMFIono.
| int ccmc::Model::getBusyStatus | ( | ) |
| float ccmc::Model::getConversionFactorToSI | ( | const std::string & | variable | ) |
Returns the conversion factor needed to convert the interpolated value to SI units.
| variable | Variable to request the conversion factor for. |
| const std::vector< int > *const ccmc::Model::getIntVariableFromMap | ( | const std::string & | variable | ) |
Returns a const pointer to the entry in the variableDataInt map containing the variable data.
This pointer cannot be modified.
| variable | Variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. |
| const std::vector< int > *const ccmc::Model::getIntVariableFromMap | ( | long | variable_id | ) |
Returns a const pointer to the entry in the variableDataIntByID map containing the variable data.
This pointer cannot be modified.
| variable_id | Variable id of the variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. Request the variable id by using FileReader::getVariableID(const std::string& variable) |
| std::vector< int > * ccmc::Model::getIntVariableFromMapRW | ( | const std::string & | variable | ) |
Returns a pointer to the entry in the variableDataInt map containing the variable data.
This pointer cannot be modified.
| variable | Variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. |
| std::vector< int > * ccmc::Model::getIntVariableFromMapRW | ( | long | variable_id | ) |
Returns a pointer to the entry in the variableDataIntByID map containing the variable data.
This pointer cannot be modified.
| variable_id | Variable id of the variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. Request the variable id by using FileReader::getVariableID(const std::string& variable) |
|
virtual |
Returns the list of variables that have been loaded into memory, using the loadVariable or loadVectorVariable methods.
Reimplemented in ccmc::Adapt3D, ccmc::MAS, ccmc::OpenGGCM, ccmc::BATSRUS, ccmc::ENLIL, and ccmc::SWMFIono.
| float ccmc::Model::getMissingValue | ( | ) |
Returns the missing value that will be returned when no valid data exists.
This value can be used to check whether an interpolated value is a missing value or not.
| std::string ccmc::Model::getModelName | ( | ) |
Returns the modelName of the currently selected file.
| std::string ccmc::Model::getNativeUnit | ( | const std::string & | variable | ) |
Fetches the native units of the variable as stored in the file.
| variable | Variable to request units for. |
| int ccmc::Model::getProgress | ( | ) |
| std::string ccmc::Model::getSIUnit | ( | const std::string & | variable | ) |
Returns the SI units of the specified variable.
| variable |
| const std::vector< float > *const ccmc::Model::getVariableFromMap | ( | const std::string & | variable | ) |
Returns a const pointer to the entry in the variableData map containing the variable data.
This pointer cannot be modified.
| variable | Variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. |
| const std::vector< float > *const ccmc::Model::getVariableFromMap | ( | long | variable_id | ) |
Returns a const pointer to the entry in the variableDataByID map containing the variable data.
This pointer cannot be modified.
| variable_id | Variable id of the variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. Request the variable id by using FileReader::getVariableID(const std::string& variable) |
| std::vector< float > * ccmc::Model::getVariableFromMapRW | ( | const std::string & | variable | ) |
Returns a pointer to the entry in the variableData map containing the variable data.
This pointer can be modified.
| variable | Variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. |
| std::vector< float > * ccmc::Model::getVariableFromMapRW | ( | long | variable_id | ) |
Returns a pointer to the entry in the variableDataByID map containing the variable data.
This pointer cannot be modified.
| variable_id | Variable id of the variable to fetch from memory. This assumes the variable has already been loaded into memory. If the variable has not been loaded, the pointer will be NULL. Request the variable id by using FileReader::getVariableID(const std::string& variable) |
|
protectedpure virtual |
Initializes the conversionFactorsToSI map.
These factors are used to convert interpolated values to SI units.
Implemented in ccmc::Adapt3D, ccmc::OpenGGCM, ccmc::MAS, ccmc::LFM, ccmc::BATSRUS, ccmc::ENLIL, ccmc::CTIP, ccmc::Magnetogram, and ccmc::SWMFIono.
|
protectedpure virtual |
Initializes the variableSIUnits map.
Implemented in ccmc::Adapt3D, ccmc::OpenGGCM, ccmc::MAS, ccmc::LFM, ccmc::BATSRUS, ccmc::ENLIL, ccmc::CTIP, ccmc::Magnetogram, and ccmc::SWMFIono.
| long ccmc::Model::loadVariable | ( | const std::string & | variable | ) |
Load a variable into memory.
Use this method when the variable to load is of type float
| variable | Variable to load into memory. |

| long ccmc::Model::loadVariableInt | ( | const std::string & | variable | ) |
Loads a variable into memory.
Use this method when the variable to load is of type int
| variable |

|
pure virtual |
Opens a file.
Opens a file and performs any necessary initialization required to work with the data.
| filename |
Implemented in ccmc::Adapt3D, ccmc::BATSRUS, ccmc::CTIP, ccmc::LFM, ccmc::OpenGGCM, ccmc::ENLIL, ccmc::Magnetogram, ccmc::MAS, and ccmc::SWMFIono.
|
protected |
| void ccmc::Model::setMissingValue | ( | float | missingValue | ) |
Sets the missing value to use when no valid data exists.
| missingValue |
| void ccmc::Model::setModelName | ( | std::string | modelName | ) |
Sets the model name to modelName.
| modelName |
| long ccmc::Model::unloadVariable | ( | const std::string & | variable | ) |
Unload a variable from memory. This will return FileReader::OK if the variable is removed from memory, and FileReader::VARIABLE_NOT_IN_MEMORY if the variable was not already in memory.
| variable | Variable to unload from memory. |

|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
static |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
1.8.3